﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ITSTOREBLL;

namespace ITStore.Controllers
{
    public class loginController : Controller
    {

        private ITStoreEntities db = new ITStoreEntities();
        //
        // GET: /login/



        public ActionResult Index()
        {
            return View();
        }

        public ActionResult ConditionalDislay()
        {
            if (Request.IsAuthenticated)
            {
                string s = User.Identity.Name;
                var q = from tk in db.TaiKhoans
                        where tk.tk_TenDangNhap == s
                        select tk;
                ViewBag.tkid = q.First().tk_ID;
            }
            return View();
        }

        public ActionResult ConditionalDislayadmin()
        {
            if (Request.IsAuthenticated)
            {
                string s = User.Identity.Name;
                var q = from tk in db.TaiKhoans
                        where tk.tk_TenDangNhap == s
                        select tk;
                ViewBag.tkid = q.First().tk_ID;
            }
            return View();
        }

    }
}
